-
Notifications
You must be signed in to change notification settings - Fork 478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imlement issue #480 : UDP target host address is cached #502
Conversation
Codecov Report
@@ Coverage Diff @@
## master #502 +/- ##
============================================
- Coverage 87.53% 87.45% -0.09%
+ Complexity 365 364 -1
============================================
Files 25 25
Lines 1500 1506 +6
Branches 167 167
============================================
+ Hits 1313 1317 +4
- Misses 120 123 +3
+ Partials 67 66 -1
Continue to review full report at Codecov.
|
Hi @lxhoan I like this approach, but we should at least measure what performance impact this gives ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for my last comment, I'm fine with merging this PR.
private InetAddress parseHostAddress(final String url) { | ||
HttpUrl httpUrl = HttpUrl.parse(url); | ||
private String parseHost(final String url) { | ||
HttpUrl httpUrl = HttpUrl.parse(url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is HttpUrl
able to parse URIs that do not start with the string http
? IMO we should treat this parameter as an URI
and not an URL
. The main reasons are:
- Users may finally stop using the scheme "http://" to connect via UDP. RFC 1738 for URL does not allow the scheme "udp://" but the RFC 3986 for URI does.
- If so, this line could be replaced with
URI.create(...)
and later you could useURI#getHost()
to get only the hostname.
@fmachado , I have fixed as your comment, tks |
Hi @majst01 ,
Performance impact should be inconsiderable since DNS resolving is cached at JVM level (as we discussed intensively before), so most of |
this PR is a simpler solution for #480